import "dart:core";

void main() {
    var string = 'Dart is ok';
    print(string.contains('D'));/*true*/
    print(string.contains('D', 1));/*从第2个字符开始判断，false*/
    print(string.contains(new RegExp(r'[A-Z]')));/*true*/
    print(string.startsWith('is'));
    print(string.endsWith('ok'));
    print(string.toLowerCase());
    print(string.toUpperCase());
    print(string.split(" "));
    print(string.padLeft(20, "*"));
    print(string.replaceAll('ok', 'not ok'));
    print(string.indexOf('is'));/*5*/
    print(string.lastIndexOf('is'));/*5*/
    print(string.compareTo(string));/*0表示相等*/
    print("0123456789".substring(0, 5));/*01234*/
    print(" 123".trimLeft());
    print("123 ".trimRight());
    print(" 123 ".trim());
}